<!-- 
 @author: Humberto Rocha Loureiro (humbertorocha@gmail.com)
 @modify: 
 -->
 
<html>
<head><title>Simple jsp page</title></head>
<body> 

<script src="../js/indent/formatterJS.js" type="text/javascript" language="javascript"></script>

<script src='/stockweb/dwr/engine.js'></script>
<script src='/stockweb/dwr/util.js'></script>
<script src='/stockweb/dwr/interface/ScriptEngineImpl.js'></script>
<script src='/stockweb/js/schema.js'></script>
 
<link rel="stylesheet" type="text/css" href="/stockweb/css/admin.css">
<input type="hidden" id="id_script" name="name" class="edit" value=""/>
<input type="hidden" id="settingchart_script" name="settingchart" class="edit" value=""/>

<table>
	<tr><td>
  <table cellspacing="0" cellpadding="0">
  	<tr><td class="label">Name:</td><td>&nbsp;</td></tr>
  	<tr><td><input type="text" id="name_script" name="name" class="edit" value=""/></td></tr>
  	<tr><td class="label">Return:</td><td>&nbsp;</td></tr>
  	<tr><td><input type="text" id="param_script" class="edit" value=""/></td></tr>
  	<tr><td class="label">Script:</td></tr>
  	<tr><td><textarea id="script_script" class="edit2" wrap="off" style="height:185px; width:480px; overflow: visible;" onkeypress="applyFormatter(event, this.id)">function applyScript(candles,json,lastbar,script) {

json.put("high", candles.High(lastbar));
json.put("low", candles.Low(lastbar));
json.put("close", candles.Close(lastbar));
json.put("open", candles.Open(lastbar));

var rs = script.call('script 02', lastbar);
println(script.get(rs,'result4'));
    
return json;

}
</textarea></td></tr>

  </table>
  </td><td>
<div style="position:absolute; left:170px; top:3px">
  <table>
  	<tr><td class="label">Descr:</td><td>&nbsp;</td></tr>
  	<tr><td><textarea id="descr_script" class="edit2" style="height:58px; width:320px"></textarea></td></tr>
  </table>
</div>
  </td></tr>

  <table>
  	<tr style="cursor:pointer">
	  <td width="50px"></td>
      <td width="50px"><img src="/stockweb/img/new.png" width="40" height="40" type="button" onClick="$script.clear()"/></td>
      <td width="50px"><img src="/stockweb/img/save.png" width="40" height="40" type="button" onClick="$script.save()"/></td>
      <td width="50px"><img src="/stockweb/img/list.png" width="40" height="40" value="LIST" type="button" onClick="$script.list()"/></td>
      <td width="50px"><img src="/stockweb/img/get.png" width="36" height="36"  value="GET"   type="button" onClick="$script.get()"/></td>
      <td width="50px"><img src="/stockweb/img/delete.png" width="40" height="40" type="button" onClick="$script.rm()"/></td>
      <td width="50px">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</td>
      <td width="50px"><img src="/stockweb/img/chart-add.png" width="40" height="40" type="button" onClick="showSetupChart()"/></td>
      <td width="50px"><img src="/stockweb/img/chart-remove.png" width="40" height="40" type="button" onClick="parent.document.getElementById('window03').style.visibility = 'visible'"/></td>
  	</tr>
  </table>

  </table>

	<div id="rsTableScript"></div>
	<div id="rsTableDataScript" style="height:110px; width:490px; overflow:auto"></div>

</body>

</html> 

<script>

	function showSetupChart(){
		//top.frames.frameSetupChart.show();
	  top.frames.frameSetupChart.addResult(document.getElementById('param_script').value, document.getElementById('settingchart_script').value);
		parent.document.getElementById('window03').style.visibility = 'visible';
	}

</script>
